package com.example.yskjproject.model;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

public class WalletModel implements Parcelable {
    @SerializedName("user_wallet")
    private UserWallet userWallet;
    @SerializedName("user_bind_info")
    private UserBindInfo userBindInfo;

    public WalletModel() {}

    // Getter 和 Setter
    public UserWallet getUserWallet() {
        return userWallet;
    }

    public void setUserWallet(UserWallet userWallet) {
        this.userWallet = userWallet;
    }

    // Parcelable 实现
    protected WalletModel(Parcel in) {
        userWallet = in.readParcelable(UserWallet.class.getClassLoader());
        userBindInfo = in.readParcelable(UserBindInfo.class.getClassLoader());

    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeParcelable(userWallet, flags);
        dest.writeParcelable(userBindInfo, flags);
    }

    public UserBindInfo getUserBindInfo() {
        return userBindInfo;
    }
    public void setUserBindInfo(UserBindInfo userBindInfo) {
        this.userBindInfo = userBindInfo;
    }
    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<WalletModel> CREATOR = new Creator<WalletModel>() {
        @Override
        public WalletModel createFromParcel(Parcel in) {
            return new WalletModel(in);
        }

        @Override
        public WalletModel[] newArray(int size) {
            return new WalletModel[size];
        }
    };
}
